﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BullTasDesaDal.Service;
using BullTasDesaDal.Entities;

namespace WSBulTasDesa.UserControls
{
    public partial class ucLocation : System.Web.UI.UserControl
    {


        public string Title
        {
            set { lblTitle.Text = value; }
        }

        public string Distance
        {
            set { lblDistance.Text = value; }
        }

        public short DistanceKm
        {
            get { return Convert.ToInt16(txtDistance.Text); }
            set { txtDistance.Text = value.ToString(); }
        }

        public Locality Locality
        {
            get
            {
                Locality locality = new Locality();
                locality.Id = Convert.ToInt32(ddlLocalitys.SelectedValue);
                locality.Name = ddlLocalitys.SelectedItem.Text;
                return locality;
            }

            set
            {
                CascadingDropDownP.SelectedValue = value.Department.Province.Id.ToString();
                CascadingDropDownD.SelectedValue = value.Department.Id.ToString();
                CascadingDropDownL.SelectedValue = value.Id.ToString();
            }

        }


    }
}